// <copyright file="EndpointValidationProviderSection.cs" company="SharpSTS">
// Copyright (c) 2007, 2008 All Right Reserved, http://sharpsts.com/
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Barry Dorrans</author>
// <email>barryd@idunno.org</email>
// <date>2008-06-14</date>
// <summary>Represents the EndpointValidation providers section in the application configuration file.</summary>

namespace SharpSTS.Configuration
{
    using System.Configuration;

    /// <summary>
    /// Represents the EndpointValidation providers section in the application configuration file.
    /// </summary>
    internal sealed class EndpointValidationProviderSection : ConfigurationSection
    {
        /// <summary>
        /// Gets the name for the configuration section group.
        /// </summary>
        /// <value>The name for the configuration section group.</value>
        public static string ConfigurationSectionName
        {
            get
            {
                return "endpointValidators";
            }
        }

        /// <summary>
        /// Gets the default endpoint validation list of providers.
        /// </summary>
        [ConfigurationProperty("providers")]
        public ProviderSettingsCollection Providers
        {
            get
            {
                return (ProviderSettingsCollection)base["providers"];
            }
        }

        /// <summary>
        /// Gets or sets the default endpoint validation provider.
        /// </summary>
        [StringValidator(MinLength = 1)]
        [ConfigurationProperty("defaultProvider", DefaultValue = "ValidateAnyEndpoint")]
        public string DefaultProvider
        {
            get
            {
                 return (string)base["defaultProvider"];
            }

            set
            {
                base["defaultProvider"] = value;
            }
        }
    }
}
